/**
 * pharma-model - 9 janv. 2011 guillaume
 */
package org.bspv.pharma.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.bspv.pharma.common.constant.Constants;

/**
 * @author guillaume
 */
@Entity
@Table(name = "STOCKLIST")
public class Stocklist implements Serializable {

    /**
     * serialVersionUID.
     */
    private static final long serialVersionUID = 1L;

    /**
     * Enumération correspondant au type de stock.
     *
     * @author guillaume
     */
    public enum StocklistTypeEnum {
        /**
         * Indique un inventaire calculé.
         */
        CALCULE,
        /**
         * Indique un inventaire constaté.
         */
        CONSTATE;
    }

    /**
     * Identifiant du stock.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    /**
     * Type de stock.
     */
    @NotNull
    @Enumerated(EnumType.STRING)
    private StocklistTypeEnum stocklistType;
    /**
     * Date de création.
     */
    @NotNull
    private Date creationDate;
    /**
     * Commentaire pour ce stock.
     */
    @Size(max = Constants.CONSTRAINT_COMMENT_SIZE)
    private String comment;
    /**
     * Numéro de version.
     */
    @Version
    private Integer version;

    /**
     * @return the id
     */
    public final Long getId() {
        return id;
    }

    /**
     * @param id
     *            the id to set
     */
    public final void setId(final Long id) {
        this.id = id;
    }

    /**
     * @return the stocklistType
     */
    public final StocklistTypeEnum getStocklistType() {
        return stocklistType;
    }

    /**
     * @param stocklistType
     *            the stocklistType to set
     */
    public final void setStocklistType(final StocklistTypeEnum stocklistType) {
        this.stocklistType = stocklistType;
    }

    /**
     * @return the creationDate
     */
    public final Date getCreationDate() {
        return creationDate;
    }

    /**
     * @param creationDate
     *            the creationDate to set
     */
    public final void setCreationDate(final Date creationDate) {
        this.creationDate = creationDate;
    }

    /**
     * @return the comment
     */
    public final String getComment() {
        return comment;
    }

    /**
     * @param comment
     *            the comment to set
     */
    public final void setComment(final String comment) {
        this.comment = comment;
    }

    /**
     * @return the version
     */
    public final Integer getVersion() {
        return version;
    }

    /**
     * @param version
     *            the version to set
     */
    public final void setVersion(final Integer version) {
        this.version = version;
    }

}
